import React, { Component } from "react";
import { View, Button, Text } from "@tarojs/components";
import Taro from "@tarojs/taro";
import { observer, inject } from "mobx-react";
import classNames from "classnames";
import { FileComponent } from "./file-component";
import "./index.scss";
import { NavBar } from "../../../src/components/nav-bar";
import { RootStore } from "../../../src/store/root-store";

interface Index {
  props: {
    rootStore: RootStore;
  };
}

@inject("rootStore")
@observer
class Index extends Component {
  componentWillMount() { }

  componentDidMount() { }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }

  render() {
    const { rootStore } = this.props;
    const { router } = Taro.getCurrentInstance();
    return (
      <View className={classNames("file-page", {})}>
        <NavBar
          className="nav-bar"
          left={undefined}
          center={router?.params.filename || "文件夹"}
          right={undefined}
          fixed
        ></NavBar>
        <FileComponent />
      </View>
    );
  }
}

export default Index;
